package com.example.cricketscorer.client.view;

import com.example.cricketscorer.client.presenter.BattingPresenter.IBattingView;
import com.example.cricketscorer.client.widget.impl.MyTable;
import com.example.cricketscorer.client.widget.interfaces.ITable;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

public class BattingView extends Composite implements IBattingView {
	
	private MyTable battingTable = new MyTable();
	
	public BattingView() {
		
		VerticalPanel mainPanel = new VerticalPanel();
		mainPanel.add( battingTable );
		mainPanel.setStyleName( "batting" );

		battingTable.setStyleName( "batting" );
		battingTable.setCellPadding( 1 );
		battingTable.setCellSpacing( 1 );
		battingTable.getRowFormatter().setStyleName( 0, "header" );
		battingTable.setText( 0, 0, "Batsmen" );
		battingTable.setText( 0, 1, "Runs" );
		battingTable.setText( 0, 2, "Balls" );
		battingTable.setText( 0, 3, "4s" );
		battingTable.setText( 0, 4, "6s" );		
		
		initWidget(mainPanel);
	}

	@Override
	public Widget getMyWidget() {
		return this;
	}

	@Override
	public ITable getTable() {
		return battingTable;
	}
}
